/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cx1.model.utils;

import java.util.Comparator;
import org.cx1.model.Listing;
import org.cx1.model.Photo;

/**
 *
 * @author ECH
 */
public class PhotoComparator implements Comparator<Photo> {
    @Override
    public int compare(Photo o1, Photo o2) {        
        if (o1.getDateCreated() != null && o2.getDateCreated() != null) {
            return (o1.getDateCreated().compareTo(o2.getDateCreated()));            
        }
        else {
            return 0;
        }
    }
}
